perm filename PUZZB.SAI[225,JMC] blob sn#005374 filedate 1971-05-23 generic text, type T, neo UTF8
00100	begin integer p,c,i,i1,i2,i3,i4,i5,i6,i7,i8,i9,j2,j3,j4,j5,
00200	j6,j7,j8,j9;
00250	integer ch,E,B,D,flag;
00300	preload_with
00400	4,2,1,2,4,2,1,
00500	2,4,1,3,2,4,1,
00600	1,2,3,4,1,2,3,
00700	4,3,1,3,4,3,1,
00800	2,2,1,4,2,2,1,
00900	2,1,3,4,2,1,3,
01000	4,2,3,1,4,2,3,
01100	1,1,1,2,1,1,1,
01200	2,1,4,3,2,1,4;
01300	integer array a[1:9,0:6],occ[1:9];
01400	for i ← 1 step 1 until 9 do occ[i] ← 0;
01500	p ← 11;
01600	
01700	ch ← getchan;
01800	open(ch,"DSK",0,0,3,E,B,D);
01900	enter(ch,"FOO",flag);
     

00100	c←0;
00200	
00300	for i1 ← 1 step 1 until 9 do begin
00400	occ[i1] ← 1;
00500	for i2 ← 1 step 1 until 9 do
00600	if occ[i2] = 0 then begin
00700	occ[i2] ← 1;
00800	for j2 ← 0 step 1 until 3 do
00900	if a[i1,2] + a[i2,j2] = 5 then
01000	for i3 ← 1 step 1 until 9 do
01100	if occ[i3] = 0 then begin
01200	occ[i3] ← 1;
01300	for j3 ← 0 step 1 until 3 do
01400	if a[i2, (j2+1) ] + a[i3,(j3+3) ] = 5 then
01500	for i4 ← 1 step 1 until 9 do
01600	if occ[i4] = 0 then begin
01700	occ[i4] ← 1;
01800	for j4 ← 0 step 1 until 3 do
01900	if a[i3,j3] + a[i4,(j4+2) ] = 5 ∧
02000		a[i1,1] + a[i4,(j4+3) ] = 5 then
02100	for i5 ← 1 step 1 until 9 do
02200	if occ[i5] = 0 then begin
02300	occ[i5] ← 1;
02400	for j5 ← 0 step 1 until 3 do
02500	if a[i4,j4] + a[i5,(j5+2) ] = 5 ∧
02550	a[i5,j5] + a[i3,j3+2] = 5 then
02600	for i6 ← 1 step 1 until 9 do
02700	if occ[i6] = 0 then begin
02800	occ[i6] ← 1;
02900	for j6 ← 0 step 1 until 3 do
03000	if a[i1,0] + a[i6,(j6+2) ] = 5 ∧
03100		a[i5,(j5+3) ] + a[i6,(j6+1) ] = 5 ∧
03150	a[i6,j6]  + a[i2,j2+2] = 5 then
03200	for i7 ← 1 step 1 until 9 do
03300	if occ[i7] = 0 then begin
03400	occ[i7] ← 1;
03500	for j7 ← 0 step 1 until 3 do
03600	if a[i6,(j6+3) ] + a[i7,(j7+1) ] = 5 ∧ 
03650	a[i7,j7+3] + a[i5,j5+1] = 5  then
03700	for i8 ← 1 step 1 until 9 do
03800	if occ[i8] = 0 then begin
03900	occ[i8] ← 1;
04000	for j8 ← 0 step 1 until 3 do
04100	if a[i7,(j7+2) ] + a[i8,j8] = 5 ∧
04200		a[i1,3] + a[i8,(j8+1)] = 5 ∧
04250		a[i8,j8+3] + a[i4,j4+1] = 5 then
04300	for i9 ← 1 step 1 until 9 do
04400	if occ[i9] = 0 then
04500	for j9 ← 0 step 1 until 3 do
04600	if a[i2,(j2+3) ] + a[i9,(j9+1) ] = 5 ∧
04700		a[i8,(j8+2) ] + a[i9,j9] = 5 ∧
04725		a[i9,j9+2] + a[i7,j7] = 5 ∧
04737		a[i9,j9+3] + a[i3,j3+1] = 5 then
04750	begin
04800	c ← c + 1;
04812	if p > 10 then begin p ← 1; out(ch,"
04818	"&cvs(c)&"   ") end;
04825	out(ch," "&cvs(i1)&cvs(i2)&cvs(i3)&cvs(i4)&cvs(i5)&cvs(i6)&
04837	cvs(i7)&cvs(i8)&cvs(i9)); p ← p + 1;
04850	end;
04900	occ[i8] ← 0 end;
05000	occ[i7] ← 0 end;
05100	occ[i6] ← 0 end;
05200	occ[i5] ← 0 end;
05300	occ[i4] ← 0 end;
05400	occ[i3] ← 0 end;
05500	occ[i2] ← 0 end;
05600	occ[i1] ← 0 end;
05700	
05800	close(ch);
05850	outstr(cvs(c));
05900	end